<template>
	<view id="form">
		<view>
			<input class="title" type="text" value="text" v-model="form.title" placeholder="请输入文章标题" />
		</view>
		<view  class="content">
			<input type="text" value="text" v-model="form.content" placeholder="请输入文章内容" />
		</view>
		<view class="upload">
			<button type="default" @click="submit">上传</button>
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form:{
					title : "",
					content : "",
					viewpoint: "889观点",
					img1 : "../../../static/t1.png"
				}
			}
		},
		methods: {
			submit(){
				console.log("-----------执行添加操作-----------");
				uniCloud.callFunction({
					name:'userTopic-add',
					data:this.form,
					success:(e)=>{
						console.log(e.result);
						uni.showToast({
							title:	'添加成功',
							duration:2000
						});
						
						setTimeout("uni.navigateTo({url:'personal'})",1000)
						
					}
				})
			}
		}
	}
</script>

<style>
.title{
	height: 100rpx;
	background-color: #d2eeff;
	margin: 20rpx;
	padding-left: 40rpx;
	border-radius: 40rpx;
}
.title input{
	
}
.content{
	height: 800rpx;
	background-color: #a9c3d9;
	margin: 20rpx;
	border-radius: 40rpx;
	padding-top: 20rpx;
	padding-left: 40rpx;
}
.upload button{
	width: 300rpx;
	margin-top: 80rpx;
	background-color: #fffeea;
	border-radius: 40rpx;
	color: #999999;
	border: 1rpx solid #c3c3c3;
}
</style>
